﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Small.Html.Options
{
    public class AjaxUploadOptions
    {
        
        private bool auto;

        /// <summary>
        /// 是否自定完成
        /// </summary>
        public bool Auto
        {
            get {
                
                
                return auto; }
            set {

                if (value == false)
                {
                    auto = true;
                }
                else 
                {
                    auto = false;
                }
                 }
        }

        
        private string buttonClass;

        /// <summary>
        /// 额外增加的上传按钮样式类型
        /// </summary>
        public string ButtonClass
        {
            get { return buttonClass; }
            set { buttonClass = value; }
        }

        private string buttonCursor;

        /// <summary>
        /// 上传按钮Hover时的鼠标形状，默认值是’hand’
        /// </summary>
        public string ButtonCursor
        {
            get { return buttonCursor; }
            set { buttonCursor = value; }
        }

        private string buttonImage;

        /// <summary>
        /// 按钮的背景图片，默认为NULL
        /// </summary>
        public string ButtonImage
        {
            get { return buttonImage; }
            set { buttonImage = value; }
        }

        private string buttonText;
        /// <summary>
        /// 按钮文字
        /// </summary>
        public string ButtonText
        {
            get { return buttonText; }
            set { buttonText = value; }
        }
        private bool checkExisting;

        /// <summary>
        /// 说明：默认是false，若要检查可指明一个用于判断的脚本的路径，比如：
        /// ‘checkExisting’：’/uploadify/check-exists.php’
        /// </summary>
        public bool CheckExisting
        {
            get { return checkExisting; }
            set { checkExisting = value; }
        }
        private bool debug;

        /// <summary>
        /// 开启调试
        /// </summary>
        public bool Debug
        {
            get { return debug; }
            set { debug = value; }
        }
        private string fileObjName;

        /// <summary>
        /// ：文件对象名称。用于在服务器端获取文件。比如，把该属性设置为’
        /// myFile’,那么在PHP中获取该文件的方法是：$_FILES[‘myFile’],
        /// 该属性的缺省值为：‘Filedata’
        /// </summary>
        public string FileObjName
        {
            get { return fileObjName; }
            set { fileObjName = value; }
        }
        private Int32 fileSizeLimit;

        /// <summary>
        /// 上传文件大小限制，默认单位是KB，若需要限制大小在100KB以内
        /// </summary>
        public Int32 FileSizeLimit
        {
            get { return fileSizeLimit; }
            set { fileSizeLimit = value; }
        }
        private string fileTypeDesc;
        /// <summary>
        /// 文件类型的说明
        /// </summary>
        public string FileTypeDesc
        {
            get { return fileTypeDesc; }
            set { fileTypeDesc = value; }
        }
        private string fileTypeExts;
        /// <summary>
        /// 指定允许上传的文件类型
        /// </summary>
        public string FileTypeExts
        {
            get { return fileTypeExts; }
            set { fileTypeExts = value; }
        }
        private string formData;

        /// <summary>
        /// 指定上传文件附带的其他数据,
        /// 以Json格式回发服务器{"Text":'A',"Value":"1"}
        /// </summary>
        public string FormData
        {
            get { return formData; }
            set { formData = value; }
        }
        private Int32 height;

        public Int32 Height
        {
            get { return height; }
            set { height = value; }
        }
        private string itemTemplate;

        public string ItemTemplate
        {
            get { return itemTemplate; }
            set { itemTemplate = value; }
        }
        private string method;

        public string Method
        {
            get { return method; }
            set { method = value; }
        }
        private bool multi;

        /// <summary>
        /// 是否支持多文件上传
        /// </summary>
        public bool Multi
        {
            get { return multi; }
            set
            {

                if (value == false)
                {
                    multi = true;
                }
                else
                {
                    multi = false;
                }
            }
        }
        private string overrideEvents;

        public string OverrideEvents
        {
            get { return overrideEvents; }
            set { overrideEvents = value; }
        }

        private bool preventCaching;
        /// <summary>
        /// 若设置为true，一个随机数将被加载swf文件URL的后面，
        /// 防止浏览器缓存。默认值为true
        /// </summary>
        public bool PreventCaching
        {
            get { return preventCaching; }
            set
            {

                if (value == false)
                {
                    preventCaching = true;
                }
                else
                {
                    preventCaching = false;
                }
            }
        }
        /// <summary>
        /// 设置文件上传时显示的数据，有两个选择：‘上传速度‘或者’百分比‘，
        /// 分别对应’speed’和’percentage’
        /// </summary>
        private string progressData;

        public string ProgressData
        {
            get { return progressData; }
            set { progressData = value; }
        }
        private string queueID;
        /// <summary>
        /// 表示上传队列的DOM元素的ID号
        /// </summary>
        public string QueueID
        {
            get { return queueID; }
            set { queueID = value; }
        }
        private int queueSizeLimit;

        /// <summary>
        /// 队列长度限制，缺省值999
        /// </summary>
        public int QueueSizeLimit
        {
            get { return queueSizeLimit; }
            set { queueSizeLimit = value; }
        }
        private bool removeCompleted;
        /// <summary>
        /// 表示在上传完成后是否删除队列中的对应元素。默认是True，
        /// 即上传完成后就看不到上传文件进度条了
        /// </summary>
        public bool RemoveCompleted
        {
            get { return removeCompleted; }
            set
            {

                if (value == false)
                {
                    removeCompleted = true;
                }
                else
                {
                    removeCompleted = false;
                }
            }
        }

        private Int32 removeTimeout;
        /// <summary>
        /// 表示上传完成后多久删除队列中的进度条，默认为3，即3秒。
        /// </summary>
        public Int32 RemoveTimeout
        {
            get { return removeTimeout; }
            set { removeTimeout = value; }
        }

       
        private bool requeueErrors;
        /// <summary>
        /// 若设置为True，那么在上传过程中因为出错导致
        /// 上传失败的文件将被重新加入队列
        /// </summary>
        public bool RequeueErrors
        {
            get { return requeueErrors; }
            set { requeueErrors = value; }
        }
        private int successTimeout;

        /// <summary>
        /// 表示文件上传完成后等待服务器响应的时间。超过该时间，
        /// 那么将认为上传成功。默认是30，表示30秒。
        /// </summary>
        public int SuccessTimeout
        {
            get { return successTimeout; }
            set { successTimeout = value; }
        }
        private string swf;

        /// <summary>
        /// swf文件路径
        /// </summary>
        public string Swf
        {
            get { return swf; }
            set { swf = value; }
        }
        //Url
        private string uploader;

       /// <summary>
        /// 服务器端脚本文件路径
       /// </summary>
        public string Url
        {
            get { return uploader; }
            set { uploader = value; }
        }
        private Int32 uploadLimit;

        /// <summary>
        /// 最多上传文件数量，默认999
        /// </summary>
        public int UploadLimit
        {
            get { return uploadLimit; }
            set { uploadLimit = value; }
        }
        private Int32 width;

        /// <summary>
        /// 默认为120
        /// </summary>
        public Int32 Width
        {
            get { return width; }
            set { width = value; }
        }



        private string onCancel;//

        /// <summary>
        /// Js函数 function(file) 
        /// </summary>
        public string OnCancel
        {
            get { return onCancel; }
            set { onCancel = value; }
        }


        private string onClearQueue;//
        /// <summary>
        /// js
        /// function(queueitemcount)
        /// </summary>
        public string OnClearQueue
        {
            get { return onClearQueue; }
            set { onClearQueue = value; }
        }

        private string onDestroy;//
        /// <summary>
        /// functiont(){}
        /// </summary>
        public string OnDestroy
        {
            get { return onDestroy; }
            set { onDestroy = value; }
        }

        private string onDialogClose;//

        /// <summary>
        /// funciton(queueData)
        /// </summary>
        public string OnDialogClose
        {
            get { return onDialogClose; }
            set { onDialogClose = value; }
        }

        private string onDialogOpen;//

        /// <summary>
        /// function(){}
        /// </summary>
        public string OnDialogOpen
        {
            get { return onDialogOpen; }
            set { onDialogOpen = value; }
        }

        private string onDisable;//

        public string OnDisable
        {
            get { return onDisable; }
            set { onDisable = value; }
        }

        private string onEnable;//

        public string OnEnable
        {
            get { return onEnable; }
            set { onEnable = value; }
        }

        private string onFallback;//

        /// <summary>
        /// 没有兼容flase触发
        /// </summary>
        public string OnFallback
        {
            get { return onFallback; }
            set { onFallback = value; }
        }

        private string onInit;//

        /// <summary>
        /// function(queue)
        /// </summary>
        public string OnInit
        {
            get { return onInit; }
            set { onInit = value; }
        }

        private string onQueueComplete;//

        /// <summary>
        /// function (queueData)
        /// </summary>
        public string OnQueueComplete
        {
            get { return onQueueComplete; }
            set { onQueueComplete = value; }
        }
        /// <summary>
        /// funciton(file)
        /// </summary>
        private string onSelect;//

        public string OnSelect
        {
            get { return onSelect; }
            set { onSelect = value; }
        }

        private string onSelectError;//

        public string OnSelectError
        {
            get { return onSelectError; }
            set { onSelectError = value; }
        }

        private string onSWFReady;//
        /// <summary>
        /// flash对象加载成功之后触发
        /// </summary>
        public string OnSWFReady
        {
            get { return onSWFReady; }
            set { onSWFReady = value; }
        }

        private string onUploadComplete;//
        /// <summary>
        /// 上传文件成功之后触发(每一个文件)
        /// function(file){}
        /// </summary>
        public string OnUploadComplete
        {
            get { return onUploadComplete; }
            set { onUploadComplete = value; }
        }

        private string onUploadError;//

        public string OnUploadError
        {
            get { return onUploadError; }
            set { onUploadError = value; }
        }

        private string onUploadProgress;//

        public string OnUploadProgress
        {
            get { return onUploadProgress; }
            set { onUploadProgress = value; }
        }

        private string onUploadStart;//

        public string OnUploadStart
        {
            get { return onUploadStart; }
            set { onUploadStart = value; }
        }

        private string onUploadSuccess;//

        /// <summary>
        /// 上传成功后触发
        ///function(file,data,response) 
        /// </summary>
        public string OnUploadSuccess
        {
            get { return onUploadSuccess; }
            set { onUploadSuccess = value; }
        }

        //•cancel
        //•destroy
        //•disable
        //•settings
        //•stop
        //•upload

       

    }
}
